package cn.lingyangwl.agile.system.controller.app;

import cn.lingyangwl.agile.ram.*;
import cn.lingyangwl.agile.system.model.rqrs.menu.*;
import cn.lingyangwl.agile.system.service.*;
import cn.lingyangwl.framework.core.response.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 移动端菜单
 * 
 * @author shenguangyang
 */
@Api(tags = "移动端菜单")
@RestController
@RequestMapping("/app/mobileMenu")
public class AppMobileMenuController {
    @Resource
    private MobileMenuService mobileMenuService;

    @ApiOperation(value = "查询移动端菜单(分组)")
    @GetMapping("/list")
    @RamResource(action = "sys:appMobileMenu:query", name = "app-查询移动端菜单", type = ActionType.READ)
    public Resp<List<MobileMenuTreeResp>> listMobileMenuTree(@Validated MobileMenuListReq req) {
        return Resp.ok(mobileMenuService.listMobileMenuTree(req));
    }
}
